import processing.core.PApplet;
import processing.core.PVector;

public class Rect {
  public PApplet parent;

  public PVector position = new PVector(0, 0, 0);

  public float width = 0;
  public float height = 0;

  public float scaleX = 100;
  public float scaleY = 100;

  public float rotation = 0;

  public float alpha = 255;
  int colour = 0;

  public Rect(PApplet _parent, float _x, float _y, float _width, float _height, int _color) {
    parent = _parent;
    position = new PVector(_x,_y,0);
    width = _width;
    height = _height;
    colour = _color;
    rotation = 0;
  }

  public Rect(PApplet _parent, int _x, int _y, int _width, int _height, int _color) {
    parent = _parent;
    position = new PVector(_x,_y,0);
    width = (float)_width;
    height = (float)_height;
    colour = _color;
    rotation = 0;
  }


  public void draw() {
    parent.pushMatrix();
    parent.translate(position.x, position.y, position.z);
    parent.scale(scaleX, scaleY);
    parent.rotate(rotation);
    parent.noStroke();
    parent.fill(colour, alpha);
    parent.rect(0, 0, width, height);
    parent.popMatrix();
  }
}



